<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>target example</title>
<style>
div {
	top:10;
	left:20;
	position:relative;
	border:solid gold 3px;
}
#div1 {
	width:400;
	height:200;
}
#div2 {
	width:300;
	height:150;
}
#div3 {
	width:200;
	height:100;
}
</style>
</head>
<body >
<div  id="div1"  > this is div 1;
  <div  id="div2"  > this is div 2;
    <div  id="div3"> this is div 3; </div>
  </div>
</div>
<script type="text/javascript">


function highlightTarget(evt) {
evt=evt||window.event;
var t=evt.target||evt.srcElement;
alert("事件源是："+t.id);
if(evt.currentTarget) alert("注册事件元素是:"+evt.currentTarget.id);
t.style.backgroundColor = 'blue';
}


div2.onmousedown=highlightTarget;
</script>
</body>
</html>
